package com.guo.springboot_elasticsearch.dao;

import com.guo.springboot_elasticsearch.test.Customer;
import org.elasticsearch.index.query.QueryBuilder;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.elasticsearch.core.query.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Optional;

/**
 * @ClassName CustomerRepository
 * @Description ???
 * @Author 32688
 * @Date 2021年 07月 01日 16:23
 */
@Component
public interface CustomerRepository extends ElasticsearchRepository<Customer, String> {
    /**
     * 通过名字搜索
     *
     * @param firstName
     * @return
     */
    List<Customer> findByFirstName(String firstName);

    /**
     * 通过姓氏搜索
     *
     * @param lastName
     * @return
     */


    List<Customer> findByLastName(String lastName);

}
